import { defineConfig } from 'vitepress'
import { set_sidebar } from "../utils/auto-gen-sidebar.mjs";	// 改成自己的路径

// const base = '/src/';
// https://vitepress.dev/reference/site-config
export default defineConfig({
  // base,
  srcDir: 'src',
  cleanUrls: true,
  title: "支点软件",
  // titleTemplate: ':title - 支点软件',
  description: "描述",
  assetsDir: 'public',
  head: [["link", { rel: "icon", href: `/logo.svg` }]],
  themeConfig: {
    // siteTitle: 'xxxx',
    logo: `/logo.svg`,
    outline: 'deep', //'deep'` 与 `[2, 6]` 相同，将显示从 `<h2>` 到 `<h6>` 的所有标题。
    outlineTitle: '导航',
    lastUpdated: '最后更新时间',
    editLink: false,
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      {
        text: '小程序', items: [
          { text: '配置', link: '/applet/configs' },
          { text: '原生', link: '/applet/native' },
          {
            text: 'uniapp', items: [
              { text: '半云端', link: '/applet/uniapp/half_cloud' },
              { text: '纯云端', link: '/applet/uniapp/pure_cloud' }
            ]
          }
        ]
      },
      {
        text: 'API', items: [
          { text: '老版本', link: '/api_v1' },
          { text: '新版本(纯云端)', link: '/api_v2' },
        ]
      },
      { text: '常见问题', link: '/qa' },
      { text: '笔记', link: '/note' },
      {
        text: '其它', items: [
          { text: '监控', link: '/third_party_platforms/监控.md' },
          { text: 'wot-design-uni', link: '/wot-design-uni/index.md' },
          { text: 'pure-admin-doc', link: '/pure-admin-doc/01.指南/01.介绍.md' }
        ]
      },
    ],
    footer: {
      message: '支点软件',
      copyright: 'Copyright © 2014-2019 支点网 蜀ICP备12000222号-6 All Rights Reserved'
    },
    sidebar: {
      "/applet/native": [{
        text: '起步',
        link: '/applet/native/index.md'
      }, {
        text: '页面模板',
        link: '/applet/native/page.md'
      }, {
        text: '插件',
        link: '/applet/native/plugins.md'
      }, {
        text: 'Mixins',
        link: '/applet/native/Mixins.md'
      }, {
        text: '组件',
        link: '/applet/native/components/index.md',
        items: [...set_sidebar(`applet/native/components`)]
      }],
      "/applet/uniapp/half_cloud": [{
        text: '起步',
        link: '/applet/uniapp/half_cloud/index.md'
      }, ...set_sidebar(`applet/uniapp/half_cloud`), {
        text: '更多',
        link: "/applet/uniapp/half_cloud/更多.md"
      }],
      "/applet/uniapp/pure_cloud": [{
        text: '起步',
        link: '/applet/uniapp/pure_cloud/index.md'
      }, ...set_sidebar(`applet/uniapp/pure_cloud`), {
        text: '更多',
        link: "/applet/uniapp/pure_cloud/更多.md"
      }],
      "/api_v1": [{
        text: '开始',
        link: "/api_v1/index.md"
      }, ...set_sidebar(`api_v1`), {
        text: '更多',
        link: "/api_v1/更多.md"
      }],
      "/api_v2": [{
        text: '开始',
        link: "/api_v2/index.md"
      }, ...set_sidebar(`api_v2`)],
      "/qa": [{
        text: '开始',
        link: "/qa/index.md"
      }, ...set_sidebar(`qa`), {
        text: '更多',
        link: "/qa/更多.md"
      }],
      "/note": [{
        text: '开始',
        link: "/note/index.md"
      }, ...set_sidebar(`note`)],
      "/wot-design-uni": [...set_sidebar(`wot-design-uni`)],
      "/pure-admin-doc": [...set_sidebar(`pure-admin-doc`)]
    },
    search: {
      provider: 'local',
      options: {
        translations: {
          button: {
            buttonText: '搜索文档',
            buttonAriaLabel: '搜索文档'
          },
          modal: {
            noResultsText: '无法找到相关结果',
            resetButtonTitle: '清除查询条件',
            footer: {
              selectText: '选择',
              navigateText: '切换'
            }
          }
        }
      }
    }
  }
})
